package project1;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.IOException;

@Gomoku_Component("加载按钮事件监听类")
public class LoadButtonListener implements ActionListener {
    SaveGomoku sg = new SaveGomoku();
    DrawGomoku dg = new DrawGomoku();
    public LoadButtonListener(SaveGomoku sg, DrawGomoku dg) {
        this.sg = sg;
        this.dg = dg;
    }

    @Override
    public void actionPerformed(ActionEvent e) {
        try {
            sg.loadGomoku(dg);
            System.out.println("棋盘加载成功！");
        } catch (IOException ex) {
            throw new RuntimeException(ex);
        }
    }
}
